package lab8.task1;

public class Calculator {

	public static void main(String[] args) {
		String er = "Error";
		String res = "Result: ";
		
		if(args.length!=3) {
			System.out.println(er);
			return;
		}
		
		double operand1 = 0;
		double operand2 = 0;
		char operation = 0;
		
		operand1 = Double.parseDouble(args[0]);
		operation = args[1].charAt(0);
		operand2 = Double.parseDouble(args[2]);

		switch (operation) {
		case '+':
			System.out.println(res+ (operand1 + operand2));
			break;
		case '-':
			System.out.println(res+ (operand1 - operand2));
			break;
		case 'x':
			System.out.println(res+ (operand1 * operand2));
			break;
		case '/':
			System.out.println(res+ (operand1 / operand2));
			break;
		default:
			break;
		}		

	}
}